//
//@File    :	5.16_textin1.cpp
//@Time    :	2021/08/06 18:07:13
//@Auther  :	Sun Sheng
//@Contact :	970340843@qq.com
//@Desc    :	reading chars with a while loop
//

#include <iostream>

using namespace std;
int main()
{
    char ch;
    int count = 0;
    cout<<"Enter charaters;enter # to quit:\n";
    cin>>ch;
    while (ch!='#')
    {
        cout<<ch;
        ++count;
        cin>>ch;
    }
    cout<<endl<<count<<" charaters read\n";
    system("pause");
    return 0;
}